﻿using System.Net;
using System.Web.Mvc;
using Dexter.Logger.Contracts;
using Dexter.Search;
using Dexter.Services;
using Dexter.Web.Mvc.Filters;
using Dexter.Web.Mvc.ViewModel.ViewsData;
using Dexter.Web.Mvc.ViewsData;
using Dexter.Web.Utils;

namespace Dexter.Web.Mvc.Controllers.FrontEnd {
	[DexterCallFilter ( true )]
	public class NotFoundController : PublicControllerBase {
		public NotFoundController ( ISearchService searchService , ICommentService commentService , IReferrerService referrerService , IConfigurationService configurationService , IWebUtils webUtils , ILogger logger , IUrlBuilder urlBuilder , IBlogRollService blogRollService , ICategoryService categoryService , IPostService postService , IThemeManager themeManager , ITagService tagService , IPageService pageService ) : base ( searchService , commentService , referrerService , configurationService , webUtils , logger , urlBuilder , blogRollService , categoryService , postService , themeManager , tagService , pageService ) {}

		[AcceptVerbs(HttpVerbs.Get | HttpVerbs.Head)]
		public ViewResult Index ( string aspxerrorpath ) {
			var data = base.GetViewData ( new PublicBaseViewData ( base.WebUtils , base.Configuration , base.UrlBuilder ) );

			Response.StatusCode = ( int )HttpStatusCode.NotFound;
			return View ( data );
		}
	}
}
